package com.atguigu.contacts;

import java.util.Scanner;

public class ArrayTest2 {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		System.out.println("请输入学生数量");
		int number = scan.nextInt();
		int[] scoresArr = new int[number];
		int index = 0,maxScore = 0;
		while (index<5) {
			System.out.println("请输入学生成绩");
			int score = scan.nextInt();
			maxScore = score> maxScore?score:maxScore;
			scoresArr[index] = score;
			index++;
		}
		for (int i = 0; i < scoresArr.length; i++) {
			int minus = maxScore - scoresArr[i];
			char type = 'A';
			if (minus < 10) {
				type = 'A';
			} else if (minus < 20) {
				type = 'B';
			}  else if (minus < 30) {
				type = 'C';
			}  else {
				type = 'D';
			} 
			System.out.println("学生 " + i+ " 成绩： " + scoresArr[i] + " 等级：" + type);
		}
	}
}
